package com.jerry.provider.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jerry.common.bean.Product;
import com.jerry.provider.dao.ProductDao;
import com.jerry.provider.service.ProductService;

@Service
public class ProductServiceImpl implements ProductService {
	
	@Autowired
	private ProductDao productDao;

	@Override
	public List<Product> list() {
		return productDao.findAll();
	}
	
	@Override
	public Product get(Long id) {
		return productDao.findById(id);
	}
	
	@Override
	public boolean add(Product product) {
		return productDao.add(product);
	}

	@Override
	public boolean update(Product product) {
		return productDao.update(product);
	}
	
	@Override
	public void delete(Long id) {
		productDao.deleteById(id);
	}
	
}
